<template>
  <el-dropdown @command="eventHandler">
    <span class="el-dropdown-link">
      <el-button type="primary" size="small " icon="el-icon-plus" circle></el-button>
    </span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item command="uploadFile">上传文件</el-dropdown-item>
      <el-dropdown-item command="createFolder">新建文件夹</el-dropdown-item>
    </el-dropdown-menu>
    <!-- 文件上传-->
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </el-dropdown>
</template>

<script>
import {methods} from "babel-plugin-transform-runtime/lib/definitions";

export default {
  name: "UpLoadFile",
  data() {
    return {
      dialogVisible: false
    }
  },
  methods:{
    eventHandler(event) {
      if (event === 'uploadFile'){
        this.dialogVisible = true;
      }
    }
  }
}
</script>

